package com.dpj.cms.controller;

import com.dpj.cms.entity.CrmBanner;
import com.dpj.cms.service.CrmBannerService;
import com.dpj.commonutils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/cms/bannerfront")
public class BannerFrontController {
    @Autowired
    private CrmBannerService bannerService;
    //查询前两条banner
    @GetMapping("getAllBanner")
    public Result getAllBanner() {
        List<CrmBanner> list = bannerService.selectAllBanner();
        return Result.ok().data("list", list);
    }
}
